package com.xiweicheng.test.jpa;
// Generated 2018-7-14 9:20:43 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 * ChatReply generated by hbm2java
 */
@Entity
@Table(name = "chat_reply", catalog = "tms")
public class ChatReply implements java.io.Serializable {

	private Long id;
	private long version;
	private ChatChannel chatChannel;
	private Users usersByCreator;
	private Users usersByUpdater;
	private String content;
	private Date createDate;
	private String status;
	private String type;
	private String ua;
	private Date updateDate;
	private Set<ChatAt> chatAts = new HashSet<ChatAt>(0);
	private Set<ChatStow> chatStows = new HashSet<ChatStow>(0);

	public ChatReply() {
	}

	public ChatReply(String status) {
		this.status = status;
	}

	public ChatReply(ChatChannel chatChannel, Users usersByCreator, Users usersByUpdater, String content,
			Date createDate, String status, String type, String ua, Date updateDate, Set<ChatAt> chatAts,
			Set<ChatStow> chatStows) {
		this.chatChannel = chatChannel;
		this.usersByCreator = usersByCreator;
		this.usersByUpdater = usersByUpdater;
		this.content = content;
		this.createDate = createDate;
		this.status = status;
		this.type = type;
		this.ua = ua;
		this.updateDate = updateDate;
		this.chatAts = chatAts;
		this.chatStows = chatStows;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "version", nullable = false)
	public long getVersion() {
		return this.version;
	}

	public void setVersion(long version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "chat_channel")
	public ChatChannel getChatChannel() {
		return this.chatChannel;
	}

	public void setChatChannel(ChatChannel chatChannel) {
		this.chatChannel = chatChannel;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "creator")
	public Users getUsersByCreator() {
		return this.usersByCreator;
	}

	public void setUsersByCreator(Users usersByCreator) {
		this.usersByCreator = usersByCreator;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "updater")
	public Users getUsersByUpdater() {
		return this.usersByUpdater;
	}

	public void setUsersByUpdater(Users usersByUpdater) {
		this.usersByUpdater = usersByUpdater;
	}

	@Column(name = "content")
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "type")
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "ua", length = 1000)
	public String getUa() {
		return this.ua;
	}

	public void setUa(String ua) {
		this.ua = ua;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_date", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "chatReply")
	public Set<ChatAt> getChatAts() {
		return this.chatAts;
	}

	public void setChatAts(Set<ChatAt> chatAts) {
		this.chatAts = chatAts;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "chatReply")
	public Set<ChatStow> getChatStows() {
		return this.chatStows;
	}

	public void setChatStows(Set<ChatStow> chatStows) {
		this.chatStows = chatStows;
	}

}
